<?php
Framework::needsToImplement("ICodeInterface");
Framework::needsToImplement("IWCDefaults");

class SendDataButton implements ICodeInterface, IWCDefaults  {
	private $icode;
	private $url;
	private $method;
	private $id;
	private $label;
	/**
	 * @return unknown
	 */
	public function getId() {
		return $this->id;
	}
	
	/**
	 * @return unknown
	 */
	public function getLabel() {
		return $this->label;
	}
	
	/**
	 * @param unknown_type $id
	 */
	public function setId($id) {
		$this->id = $id;
	}
	
	/**
	 * @param unknown_type $label
	 */
	public function setLabel($label) {
		$this->label = $label;
	}

	/**
	 * @return unknown
	 */
	public function getMethod() {
		return $this->method;
	}
	
	/**
	 * @return unknown
	 */
	public function getUrl() {
		return $this->url;
	}
	
	/**
	 * @param unknown_type $method
	 */
	public function setMethod($method) {
		$this->method = $method;
	}
	
	/**
	 * @param unknown_type $url
	 */
	public function setUrl($url) {
		$this->url = $url;
	}

	public function __construct(){
		$this->icode=Array(
			'add'=>'addElement',
			'action'=>'setURL',
			'method'=>'setMethod',
			'sendtoelement'=>'setMethod',
			'openwindow'=>'setMethod',
			'label'=>'setLabel',
			'id'=>'setId'
		);		
	}
	public function icodeSupportedProperties(){
		return $this->icode;
	}
	public function icodeSet($prop,$value){
		if(isset($this->icode[$prop])) {
				$op=$this->icode[$prop];
				$this->$op($value);			
		}
	}
	public function __toString(){
		return '<input type="button" value="'.$this->label.'" />';
	}
	
}
?>